export const getFileNameFromUrl = (url) => {
  const match = url.match(/([^/]+)\.([^/]+)?$/); // 使用正则表达式匹配文件名（不包括扩展名）
  let fileName;
  if (match && match[1]) {
    fileName = match[1];
  }
  return fileName;
};


export const getUsefulInfo = ()=>{

}

export const rmNthElementFromSet = (set, n)=> {
  // 将Set转换为数组
  const array = Array.from(set);
  // 删除第n个元素
  array.splice(n - 1, 1);
  // 将数组转换回Set集合
  return new Set(array);
}

export const rmFieldsFromObject = (obj, fields)=>{
  const newObj = {};
  for (const key in obj) {
    if (!fields.includes(key)) {
      newObj[key] = obj[key];
    }
  }
  return newObj;
}